<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
	<head>
		<title>个人中心－我的资料</title>
	</head>
	<body>
	
		<!-- self_info -->
		<div class="grzxbj">
			<div class="selfinfo center">
			<div class="lfnav fl">
				<div class="ddzx">我的商品</div>
				<div class="subddzx">
					<ul>
						<li><a href="${pageContext.request.contextPath}/toMy/sell">出售中的商品</a></li>
						<li><a href="${pageContext.request.contextPath}/toMy/tradingSuccess">已出售的商品</a></li>
						<li><a href="${pageContext.request.contextPath}/toMy/trading">交易中的商品</a></li>
						<li><a href="${pageContext.request.contextPath}/toMy/shelves">已下架的商品</a></li>
					</ul>
				</div>
				<div class="ddzx">个人中心</div>
				<div class="subddzx">
					<ul>
						<li><a href="${pageContext.request.contextPath}/toMy/my" style="color:#ff6700;font-weight:bold;">我的资料</a></li>
						<li><a href="${pageContext.request.contextPath}/toMy/notice">消息通知</a></li>
						<li><a href="${pageContext.request.contextPath}/toMy/rMessage">收到的留言</a></li>
						<li><a href="${pageContext.request.contextPath}/toMy/sMessage">发布的留言</a></li>
						<li><a href="${pageContext.request.contextPath}/toMy/criminalRecords">违规记录</a></li>
						<li><a href="${pageContext.request.contextPath}/toMy/report">举报记录</a></li>
					</ul>
				</div>
			</div>
			<div class="rtcont fr">
				<div class="grzlbt ml40">我的资料</div>
				<div class="subgrzl ml40">
					<span>头像</span>
					<span><img src="/csht_file/user_header/${cshtUserVo.userHeadPath}"></span>
					<span class="site-demo-button" id="userHeadPath-btn" style="margin-bottom: 0;">
						<a data-method="notice" class="layui-btn" href="javascript:void(0)" style="background:none;">修改</a>
					</span>
				</div>
				<div class="subgrzl ml40">
					<span>用户名</span>
					<span>${cshtUserVo.userUsername}</span>
					<span class="site-demo-button" id="userUsername-btn" style="margin-bottom: 0;">
						<a data-method="notice" class="layui-btn" href="javascript:void(0)" style="background:none;">修改</a>
					</span>
				</div>
				<div class="subgrzl ml40">
					<span>密码</span>
					<span>***********</span>
					<span class="site-demo-button" id="userPassword-btn" style="margin-bottom: 0;">
						<a data-method="notice" class="layui-btn" href="javascript:void(0)" style="background:none;">修改</a>
					</span>
				</div>
				<div class="subgrzl ml40">
					<span>手机号</span>
					<span id="userTel-span"></span>
					<span class="site-demo-button" title="手机号不能修改" id="userTel-btn" style="margin-bottom: 0;">
						<a data-method="notice" class="layui-btn" href="javascript:void(0)" style="background:none;cursor:not-allowed; color:#ccc;">不可修改</a>
					</span>
				</div>
				<div class="subgrzl ml40">
					<span>学校地址</span>
					<span>${cshtUserVo.userAddress}</span>
					<span class="site-demo-button" id="userAddress-btn" style="margin-bottom: 0;">
						<a data-method="notice" class="layui-btn" href="javascript:void(0)" style="background:none;">修改</a>
					</span>
				</div>
				<div class="subgrzl ml40">
					<span>性别</span>
					<span>${cshtUserVo.userGender}</span>
					<span class="site-demo-button" id="userGender-btn" style="margin-bottom: 0;">
						<a data-method="notice" class="layui-btn" href="javascript:void(0)" style="background:none;">修改</a>
					</span>
				</div>
				<div class="subgrzl ml40">
					<span>QQ号</span>
					<c:if test="${cshtUserVo.userqq != '' && cshtUserVo.userqq != null}">
						<span>${cshtUserVo.userqq}</span>
					</c:if>
					<c:if test="${cshtUserVo.userqq == '' || cshtUserVo.userqq == null}">
						<span>无</span>
					</c:if>
					<span class="site-demo-button" id="userqq-btn" style="margin-bottom: 0;">
						<a data-method="notice" class="layui-btn" href="javascript:void(0)" style="background:none;">修改</a>
					</span>
				</div>
				<div class="subgrzl ml40">
					<span>微信号</span>
					<c:if test="${cshtUserVo.userWechat != '' && cshtUserVo.userWechat != null}">
						<span>${cshtUserVo.userWechat}</span>
					</c:if>
					<c:if test="${cshtUserVo.userWechat == '' || cshtUserVo.userWechat == null}">
						<span>无</span>
					</c:if>
					<span class="site-demo-button" id="userWechat-btn" style="margin-bottom: 0;">
						<a data-method="notice" class="layui-btn" href="javascript:void(0)" style="background:none;">修改</a>
					</span>
				</div>
			</div>
			
			<div class="clear"></div>
			</div>
		</div>
		
		<script type="text/javascript">
			$(document).ready(function(){
				changeUserTel();
				//隐藏用户电话中间4位
				function changeUserTel(){
					var userTel = "${cshtUserVo.userTel}"; //获取用户电话
					var ycTel = userTel.charAt(0) + "" +userTel.charAt(1) + "" + userTel.charAt(2) + 
								"****" + userTel.charAt(7) + "" + userTel.charAt(8) + "" + userTel.charAt(9) 
								+ "" + userTel.charAt(10); //把中间4位变成*
					$("#userTel-span").text(ycTel);
				};
				
			//修改头像弹框
			layui.use('layer', function() { //独立版的layer无需执行这一句
				var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
				//触发事件
				var active = {
					notice : function() {
						//示范一个公告层
						layer.open({
							type : 1,
							title : '修改头像', //不显示标题栏
							closeBtn : false,
							area : '300px;',
							shade : 0.8,
							id : 'userHeadPath', //设定一个id，防止重复弹出
							btn : [ '提交', '取消' ],
							btnAlign : 'c',
							moveType : 1, //拖拽模式，0或者1
							content : '<div class="layui-upload" style="text-align:center;">' + 
										'<div class="layui-upload-list">' + 
											'<img class="layui-upload-img" id="updateUserHead-img" src="/csht_file/user_header/${cshtUserVo.userHeadPath}" style="width:80px; height:80px;">' + 
											'<p id="updateUserHead-text"></p>' + 
										'</div>' + 
										'<button type="button" class="layui-btn" id="updateUserHead-btn">选择头像</button>' + 
										'<p style="color:red; font-size:12px; padding-top:10px;">请上传不超过256*256的图片</p>' + 
									  '</div>',
							
						});
						//头像上传
						layui.use('upload', function(){
							  var $ = layui.jquery
							  ,upload = layui.upload;
							  
							  //普通图片上传
							  var uploadInst = upload.render({
								url: '${pageContext.request.contextPath}/toMy/updateUserHeadById', //上传地址
							    elem: '#updateUserHead-btn', //上传按钮
							    field: 'updateUserHead', //设置文件域名称
							    acceptMime: 'image/jpeg,image/png,image/jpg', //允许的图片类型
							    auto: false, //设置不自动上传
							    bindAction: $(".layui-layer-btn0"), //点击上传提交按钮(修改头像弹框默认设定的按钮)
							    choose: function(obj){
							      //预读本地文件示例，不支持ie8
							      obj.preview(function(index, file, result){
							        $('#updateUserHead-img').attr('src', result); //图片链接（base64）
							      });
							    },
							    done: function(res){
							        //假设code=0代表上传成功
							        if(res.code == "0"){
							        	location.reload();
							        }
							      },
							    
							  });
						});//头像上传
						
					}
				};
				$('#userHeadPath-btn .layui-btn').on('click',function() {
							var othis = $(this), method = othis.data('method');
							active[method] ? active[method].call(this, othis) : '';
						});

				});//修改头像弹框
			
			
				//修改用户名弹框
				layui.use('layer', function() { //独立版的layer无需执行这一句
					var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
					//触发事件
					var active = {
						notice : function() {
							//示范一个公告层
							layer.open({
								type : 1,
								title : '修改用户名', //不显示标题栏
								closeBtn : false,
								area : '300px;',
								shade : 0.8,
								id : 'userUsername', //设定一个id，防止重复弹出
								btn : [ '提交', '取消' ],
								btnAlign : 'c',
								moveType : 1, //拖拽模式，0或者1
								content : '<div style="padding:20px;">' + 
												'<span>请输入新用户名:</span>' + 
												'<input type="text" placeholder="请输入新用户名" id="username" name="username" autofocus style="width:100%;height:35px; padding-left:5px;font-size:14px;">' + 
												'<p id="updateUserNameText" style="color:red"></p>' + 
										  '</div>',
								success: function(layero){
									       var btn = layero.find('.layui-layer-btn');
									       btn.find('.layui-layer-btn0').on("click", function(){
									    	   if(usernameBooean == true){
									    		   var usernameVal = $("#username").val(); //获取用户名
									    		   $.ajax({
									    			   url: "${pageContext.request.contextPath}/toMy/updateUsernameById",
									    			   type: "POST",
									    			   dataType: "json",
									    			   data: {
									    				   "username": usernameVal,
									    			   },
									    			   success: function(data){
									    				   if(true == data.message){
									    					   location.reload();
									    				   }else{
									    					   layer.msg('用户名修改失败');
									    				   }
									    			   }
									    		   })
									    	   }else{
									    		   layer.msg('用户名修改失败');
									    	   }
									       })
									    }
							});
							
							var usernameBooean = false; //记录用户是否通过检验
							//用户名校验
							$("#username").blur(function(){
								var usernameVal = $("#username").val(); //获取用户名
								var regExp1 = new RegExp("[ `~!@#$^&*()=|{}':;',\\[\\].<>/?~！@#￥……&*（）&;—|{}【】‘；：”“'。，、？]");
								var regExp2 = new RegExp("^1[3|4|5|7|8][0-9]{9}$");
								if(regExp1.test(usernameVal)){
									$("#updateUserNameText").text("用户名不能包含特殊字符");
									usernameBooean = false;
								}else if(regExp2.test(usernameVal)){
									$("#updateUserNameText").text("用户名不能是手机号码格式");
									usernameBooean = false;
								}else if(usernameVal.length < 3 || usernameVal.length > 12){
									$("#updateUserNameText").text("用户名为3－12个字符长度");
									usernameBooean = false;
								}else{
									$.ajax({
										url: "${pageContext.request.contextPath}/checkUsername",
										type: "POST",
										dataType: "json",
										data: {
											"username": usernameVal,
										},
										success: function(data){
											if(true == data.res){
												$("#updateUserNameText").html("<i class='glyphicon glyphicon-ok' style='color:green'>该用户名可用</i>");
												usernameBooean = true;
											}else{
												$("#updateUserNameText").html("<i class='glyphicon glyphicon-remove'></i>该用户名已存在");
												usernameBooean = false;
											}
										}
									});
								}
							});//用户名校验
						}
					};
					$('#userUsername-btn .layui-btn').on('click',function() {
								var othis = $(this), method = othis.data('method');
								active[method] ? active[method].call(this, othis) : '';
							});

					});//修改用户名弹框
					
					
					//修改密码弹框
					layui.use('layer', function() { //独立版的layer无需执行这一句
						var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
						//触发事件
						var active = {
							notice : function() {
								//示范一个公告层
								layer.open({
									type : 1,
									title : '修改登录密码', //不显示标题栏
									closeBtn : false,
									area : '300px;',
									shade : 0.8,
									id : 'updatePassword', //设定一个id，防止重复弹出
									btn : [ '提交', '取消' ],
									btnAlign : 'c',
									moveType : 1, //拖拽模式，0或者1
									content : '<div style="padding:20px;">' + 
													'<span>请输入新密码:</span>' + 
													'<input type="password" placeholder="请输入新密码" id="userPassword" name="userPassword" autofocus style="width:100%;height:35px; padding-left:5px;font-size:14px;">' + 
													'<p id="userPasswordText" style="color:red"></p>' + 
													'<input type="password" placeholder="请再次输入密码" id="rePassword" name="rePassword" style="width:100%;height:35px; padding-left:5px;font-size:14px;">' + 
													'<p id="rePasswordText" style="color:red"></p>' + 
											  '</div>',
									success: function(layero){
										       var btn = layero.find('.layui-layer-btn');
										       btn.find('.layui-layer-btn0').on("click", function(){
										    	   if(userPasswordBoolean && rePasswordBoolean){
										    		   var userPasswordVal = $("#userPassword").val();
										    		   $.ajax({
										    			   url: "${pageContext.request.contextPath}/toMy/updateUserPasswordById",
										    			   type: "POST",
										    			   dataType: "json",
										    			   data: {
										    				   "userPassword": userPasswordVal,
										    			   },
										    			   success: function(data){
										    				   if(true == data.res){
										    					   layer.open({
										    							  content: '密码修改成功，请重新登录！',
										    							  title: '修改提示:',
										    							  icon: 1,
										    							  anim: 6,
										    							  yes: function(index, layero){
										    								  layer.close(index); //如果设定了yes回调，需进行手工关闭
										    								  location.reload();
										    								  }
										    						});
										    					   
										    				   }else{
										    					   layer.msg('密码修改失败');
										    				   }
										    			   }
										    		   })
										    	   }else{
										    		   layer.msg('密码修改失败');
										    	   }
										       })
										    }
								});
								//密码校验
								var userPasswordBoolean = false; //记录密码校验是否通过
								var rePasswordBoolean = false; //记录确认密码校验是否通过
								$("#userPassword").blur(function(){
									var userPasswordVal = $("#userPassword").val();
									var rePasswordVal = $("#rePassword").val();
									var i = userPasswordVal.length;
									if(6 > i || 16 < i){
										$("#userPasswordText").html("<i class='glyphicon glyphicon-remove'></i>密码由6－16位字符组成");
										userPasswordBoolean = false;
									}else{
										userPasswordBoolean = true;
										$("#userPasswordText").html("<i class='glyphicon glyphicon-ok' style='color:green'></i>");
									}
									if(rePasswordVal != userPasswordVal){ //确认密码校验
										rePasswordBoolean = false;
										$("#rePasswordText").html("<i class='glyphicon glyphicon-remove'></i>两次密码不一致");
									}else{
										rePasswordBoolean = true;
										$("#rePasswordText").html("<i class='glyphicon glyphicon-ok' style='color:green'></i>");
									}
								});
								
								$("#rePassword").blur(function(){
									var userPasswordVal = $("#userPassword").val();
									var rePasswordVal = $("#rePassword").val();
									if(rePasswordVal == ""){
										rePasswordBoolean = false;
										$("#rePasswordText").html("<i class='glyphicon glyphicon-remove'></i>请再次输入密码");
									}else if(rePasswordVal != userPasswordVal){ //确认密码校验
										rePasswordBoolean = false;
										$("#rePasswordText").html("<i class='glyphicon glyphicon-remove'></i>两次密码不一致");
									}else{
										rePasswordBoolean = true;
										$("#rePasswordText").html("<i class='glyphicon glyphicon-ok' style='color:green'></i>");
									}
								})
								
							}
						};
						$('#userPassword-btn .layui-btn').on('click',function() {
									var othis = $(this), method = othis.data('method');
									active[method] ? active[method].call(this, othis) : '';
								});

				});//修改密码弹框
				
				
				//修改学校地址弹框
				layui.use('layer', function() { //独立版的layer无需执行这一句
					var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
					//触发事件
					var active = {
						notice : function() {
							//示范一个公告层
							layer.open({
								type : 1,
								title : '修改学校地址', //不显示标题栏
								closeBtn : false,
								area : '300px;',
								shade : 0.8,
								id : 'userAddress', //设定一个id，防止重复弹出
								btn : [ '提交', '取消' ],
								btnAlign : 'c',
								moveType : 1, //拖拽模式，0或者1
								content : '<div style="padding:20px;">' + 
												'<select id="updateProvince" style="width:100%;height:30px;">' + 
													'<option value="请选择">请选择省份</option>' + 
												'</select>' + 
												'<select id="updateCity" style="width:100%;height:30px;">' + 
													'<option value="请选择">请选择城市</option>' + 
												'</select>' + 
												'<select id="updateSchool" style="width:100%;height:30px;">' + 
													'<option value="请选择">请选择所在学校</option>' + 
												'</select>' + 
										  '</div>',
								success: function(layero){
									       var btn = layero.find('.layui-layer-btn');
									       btn.find('.layui-layer-btn0').on("click", function(){
									    	   var provinceName = $("#updateProvince option[value=" + $("#updateProvince").val() + "]").text();
									    	   var cityName = $("#updateCity").val();
									    	   var schoolName = $("#updateSchool").val();
									    	   if(provinceName != "请选择" && cityName != "请选择" && schoolName != "请选择"){
									    		   var address = provinceName + "-" + cityName + "-" + schoolName;
									    		   $.ajax({
									    			   url: "updateUserAddressById",
									    			   type: "POST",
									    			   dataType: "JSON",
									    			   data: {
									    				   "address": address,
									    			   },
									    			   success: function(data){
									    				   if(true == data.res){
									    					   location.reload();
									    				   }else{
									    					   layer.msg('地址修改失败');
									    				   }
									    			   }
									    		   })
									    	   }else{
									    		   layer.msg('地址不完整，修改失败');
									    	   }
									       })
									    }
							});
							
							//获取地址数据
							
							//先获取省份数据
							$.ajax({
								url: "${pageContext.request.contextPath}/toMy/toUpdategetAllProvice",
								type: "POST",
								dataType: "JSON",
								success: function(data){
									for(var i = 0; i < data.provinceList.length; i++){
										$("#updateProvince").append("<option value='" + data.provinceList[i].id + "'>" + data.provinceList[i].name + "</option>")
									}
								}
							});
							//根据省份的变化获取城市
							$("#updateProvince").on("change", function(){
								var provinceId = $("#updateProvince").val();
								$("#updateCity").empty(); //省变化先清空城市和学校下拉框
								$("#updateCity").append('<option value="请选择">请选择城市</option>');
								$("#updateSchool").empty();
								$("#updateSchool").append('<option value="请选择">请选择所在学校</option>');
								if(provinceId != "请选择"){
									$.ajax({
										url: "${pageContext.request.contextPath}/toMy/toUpdategetAllCity",
										type: "POST",
										dataType: "JSON",
										data: {
											"provinceId": provinceId,
										},
										success: function(data){
											$("#updateCity").empty();
											$("#updateCity").append('<option value="请选择">请选择城市</option>');
											for(var i = 0; i < data.cityList.length; i++){
												$("#updateCity").append("<option value='" + data.cityList[i] + "'>" + data.cityList[i] + "</option>")
											}
										}
									});
								}
							});
							
							//根据城市的变化获取学校
							$("#updateCity").on("change", function(){
								var cityName = $("#updateCity").val();
								$("#updateSchool").empty(); //城市变化先清空学校下拉框
								$("#updateSchool").append('<option value="请选择">请选择所在学校</option>');
								if(cityName != "请选择"){
									$.ajax({
										url: "${pageContext.request.contextPath}/toMy/toUpdategetAllSchool",
										type: "POST",
										dataType: "JSON",
										data: {
											"cityName": cityName,
										},
										success: function(data){
											$("#updateSchool").empty();
											$("#updateSchool").append('<option value="请选择">请选择所在学校</option>');
											for(var i = 0; i < data.schoolList.length; i++){
												$("#updateSchool").append("<option value='" + data.schoolList[i].name + "'>" + data.schoolList[i].name + "</option>")
											}
										}
									});
								}
							});
							
						}
					};
					$('#userAddress-btn .layui-btn').on('click',function() {
								var othis = $(this), method = othis.data('method');
								active[method] ? active[method].call(this, othis) : '';
							});

				});//修改学校地址弹框
				
				//修改性别弹框
				layui.use('layer', function() { //独立版的layer无需执行这一句
					var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
					//触发事件
					var active = {
						notice : function() {
							//示范一个公告层
							layer.open({
								type : 1,
								title : '修改性别', //不显示标题栏
								closeBtn : false,
								area : '300px;',
								shade : 0.8,
								id : 'userGender', //设定一个id，防止重复弹出
								btn : [ '提交', '取消' ],
								btnAlign : 'c',
								moveType : 1, //拖拽模式，0或者1
								content : '<div id="userGender-div" style="text-align:center; padding:10px 0;" class="radio">' + 
												'<label class="radio-inline">' + 
													'<input type="radio" name="userGender" value="男" checked="checked">男' + 
												'</label>' + 
												'<label class="radio-inline">' + 
													'<input type="radio" name="userGender" value="女">女' + 
												'</label>' + 
										  '</div>',
								success: function(layero){
									       var btn = layero.find('.layui-layer-btn');
									       btn.find('.layui-layer-btn0').on("click", function(){
									    	  var  userGender = $("#userGender-div input[checked='checked']").val();
									    	  $.ajax({
									    		  url: "${pageContext.request.contextPath}/toMy/updateUserGenderById",
									    		  type: "POST",
									    		  dataType: "JSON",
									    		  data: {
									    			  "userGender": userGender,
									    		  },
									    		  success: function(data){
									    			  if(true == data.res){
									    				  location.reload();
									    			  }else{
									    				  layer.msg('性别修改失败');
									    			  }
									    		  }
									    	  })
									       })
									    }
							});
							
							//点击选中单选按钮
							$(".radio-inline").on("click", function(){
								$(this).children().attr("checked", "checked");
								$(this).siblings(".radio-inline").children().removeAttr("checked");
							});
							
						}
					};
					$('#userGender-btn .layui-btn').on('click',function() {
								var othis = $(this), method = othis.data('method');
								active[method] ? active[method].call(this, othis) : '';
							});

				});//修改性别弹框
				
				//修改QQ号弹框
				layui.use('layer', function() { //独立版的layer无需执行这一句
					var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
					//触发事件
					var active = {
						notice : function() {
							//示范一个公告层
							layer.open({
								type : 1,
								title : '修改QQ号', //不显示标题栏
								closeBtn : false,
								area : '300px;',
								shade : 0.8,
								id : 'userqq', //设定一个id，防止重复弹出
								btn : [ '提交', '取消' ],
								btnAlign : 'c',
								moveType : 1, //拖拽模式，0或者1
								content : '<div style="padding:20px 20px 0;">' + 
												'<input type="text" id="userqqval" autofocus placeholder="请输入QQ号" style="width:100%;height:35px; padding-left:5px;font-size:14px;>' + 
										  '</div>',
								success: function(layero){
									       var btn = layero.find('.layui-layer-btn');
									       btn.find('.layui-layer-btn0').on("click", function(){
									    	  var userqqval = $("#userqqval").val();
									    	  $.ajax({
									    		  url: "${pageContext.request.contextPath}/toMy/updateUserqqById",
									    		  type: "POST",
									    		  dataType: "JSON",
									    		  data: {
									    			  "userqq": userqqval,
									    		  },
									    		  success: function(data){
									    			  if(true == data.res){
									    				  location.reload();
									    			  }else{
									    				  layer.msg('QQ号修改失败');
									    			  }
									    		  }
									    	  })
									       })
									    }
							});
							
							//点击选中单选按钮
							$(".radio-inline").on("click", function(){
								$(this).children().attr("checked", "checked");
								$(this).siblings(".radio-inline").children().removeAttr("checked");
							});
							
						}
					};
					$('#userqq-btn .layui-btn').on('click',function() {
								var othis = $(this), method = othis.data('method');
								active[method] ? active[method].call(this, othis) : '';
							});

				});//修改QQ号弹框
				
				
				//修改微信号弹框
				layui.use('layer', function() { //独立版的layer无需执行这一句
					var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
					//触发事件
					var active = {
						notice : function() {
							//示范一个公告层
							layer.open({
								type : 1,
								title : '修改微信号', //不显示标题栏
								closeBtn : false,
								area : '300px;',
								shade : 0.8,
								id : 'userWechat', //设定一个id，防止重复弹出
								btn : [ '提交', '取消' ],
								btnAlign : 'c',
								moveType : 1, //拖拽模式，0或者1
								content : '<div style="padding:20px 20px 0;">' + 
												'<input type="text" id="userWechatval" autofocus placeholder="请输入微信号" style="width:100%;height:35px; padding-left:5px;font-size:14px;>' + 
										  '</div>',
								success: function(layero){
									       var btn = layero.find('.layui-layer-btn');
									       btn.find('.layui-layer-btn0').on("click", function(){
									    	  var userWechatval = $("#userWechatval").val();
									    	  $.ajax({
									    		  url: "${pageContext.request.contextPath}/toMy/updateUserWechatById",
									    		  type: "POST",
									    		  dataType: "JSON",
									    		  data: {
									    			  "userWechat": userWechatval,
									    		  },
									    		  success: function(data){
									    			  if(true == data.res){
									    				  location.reload();
									    			  }else{
									    				  layer.msg('微信号修改失败');
									    			  }
									    		  }
									    	  })
									       })
									    }
							});
							
							//点击选中单选按钮
							$(".radio-inline").on("click", function(){
								$(this).children().attr("checked", "checked");
								$(this).siblings(".radio-inline").children().removeAttr("checked");
							});
							
						}
					};
					$('#userWechat-btn .layui-btn').on('click',function() {
								var othis = $(this), method = othis.data('method');
								active[method] ? active[method].call(this, othis) : '';
							});

				});//修改微信号弹框

			})
		</script>
		
		
	</body>
</html>